package com.touchstone.synchdata.controller;

import com.touchstone.synchdata.common.result.ResultVO;
import com.touchstone.synchdata.service.IMultiDataSourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description : 多数据源项目控制层
 * @Author : hunter
 * @Date: 2020-06-19 14:57
 * @Version: 1.0
 **/
@RestController
@RequestMapping("/multiDatasource")
@Api(description = "多数据源项目控制层", tags = "多数据源项目控制层")
public class MultiDatasourceController {


    @Resource
    private IMultiDataSourceService multiDataSourceService;

    @GetMapping("/listVersion")
    @ApiOperation(value = "查询数据库版本", notes = "查询数据库版本")
    public ResultVO listVersion() {
        return ResultVO.success(multiDataSourceService.listVersion());
    }


    @GetMapping("/syncAccountToUser")
    @ApiOperation(value = "同步账户数据", notes = "同步账户数据")
    public ResultVO syncAccount2User() {
        return ResultVO.success(multiDataSourceService.syncAccount2User());
    }

}
